1. Technical Field
One or more embodiments of the present invention generally relate to a system and method for allocating resources for a hot-plugged device or for re-balancing resources for existing devices to support resources needed for the hot-plugged device.
2. Background Art
For Peripheral Component Interconnect (PCI) or PCI express (or PCIe) devices that are operably coupled to a PCI bus in a computer system, such devices may not function if these devices are not allocated proper resources. The resources may include input/output (I/O) addresses, memory addresses, bus numbers, etc. When a computer is powered on, a basic input/output system (BIOS) may allocate the resources for all on-board (or existing) devices and reserve a limited amount of resources for newly inserted devices (or hot-plugged devices).
In some cases, if the device is hot-plugged when the computer system is running, the system probes resource requirements requested by the hot-plugged device so that the system can allocate the identified resources from the existing devices for the hot-plugged device. At times, there may not be enough resources available from the existing devices that can be allocated to the hot-plugged device. In such cases, the hot-plugged device may not operate in the manner desired by the user.
On a Solaris® based computer system, the BIOS (or Open Boot program (OBP)) probes or programs the devices already coupled to the system and assigns such devices resources when the system is powered on. After which, an operating system (OS) boot code reads a configuration space for the devices one by one and collects the information of assigned resources and then calculates the various available resources. The properties which describe the various resources for each device are setup based on the information that is collected and calculated. After the properties for each device are established, a resource manager generates a global linked list so that available resources can be identified by a newly plugged or hot-plugged device. However, when a device is hot-plugged into the system and there are not enough resources available for such a device at the device's immediate parent node, conventional resource managers may fail the resource allocation. Further, the properties for each existing device that has resources allocated or given to the hot-plugged device may not be updated to reflect that such resources are now assigned to the hot-plugged device.